﻿jQuery(document).ready(function ($) {	
	windowResize($(window).width());
	$(window).resize(function(){
		windowResize($(this).width());
	});
	//var it= randomRange(1,4);	
	//$('#adsmb-top').append("<center><a href='"+ibetsiteurl+"' target=_blank><img src='"+staticpath+"Images/advs/m/ibet-3x-top"+it+".png' alt='iBet88'/></a></center>");
	//var w = $(window).width();
	//alert('test xiu nhe, size width = '+w);	
});
function randomRange (min, max) {
    return Math.floor(Math.random() * (max - min)) + min;
}
function windowResize(w){	
	if ( w <= 350 ) {
		jQuery('#adsmb-mid').css('margin-left','-12px');
		jQuery('#adsmb-mid').css('width','108%');
		
		jQuery('#adsmb-bottom').css('margin-left','-12px');
		jQuery('#adsmb-bottom').css('width','108%');
		jQuery('#gabottom').css('margin-left','-12px');
		jQuery('#gabottom').css('width','108%');
		
		jQuery('#adsmb-header').css('margin-left','-8px');
		jQuery('#adsmb-header').css('width','105%');
	} else {
		
	}	
}
/*
var lastScrollTop = 0;
jQuery(window).scroll(function(event){
   var st = $(this).scrollTop();
   if (st > lastScrollTop){	
	   $('.mainmenu').hide({ direction: "up" }, 500 );	//when scroll down
   } else if(st<(lastScrollTop-20)){		
	  $('.mainmenu').show({ direction: "down" }, 500);	//when scroll up
   }
   lastScrollTop = st;
});
*/